package metamodels;

import java.util.ArrayList;
import java.util.List;

import parser.generic.Node;

public class IdentifiersComma extends Node{

	private List<Identifier> identifiers;

	public IdentifiersComma() {
		identifiers = new ArrayList<Identifier>();
	}

	public void addIdentifier(Identifier identifier) {
		this.identifiers.add(identifier);
	}

	@Override
	public String toString() {
		if (identifiers.size() == 1)
			return identifiers.get(0).toString();
		else
		{
			String out = "";
			
			for (Identifier id : identifiers)
				out += id + ",";
			
			out = out.substring(0, out.length()-1);
			
			return out;
		}
	}

	public List<Identifier> getIdentifiers() {
		return identifiers;
	}
}
